package com.itheima.demo1;

import java.util.Scanner;

public class Demo21Method {
    public static void eat() {
        System.out.println("吃饭");
    }

    public static void study() {
        System.out.println("学习");
    }

    public static void method() {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        if (num % 2 == 0) {
            System.out.println("偶数");
        } else {
            System.out.println("奇数");
        }
    }

    //带参方法
    public static void method1(int num) {
        if (num % 2 == 0) {
            System.out.println("偶数");
        } else {
            System.out.println("奇数");
        }
    }

    //带参方法练习：设计一个方法打印n到m之间所有的奇数
    public static void print(int n, int m) {
        if (m < n) {
            System.out.println("传入数据错误");
            //return用于结束方法，称为方法的弹栈
            return;
        }
        for (int i = n; i <= m; i++) {
            if (i % 2 != 0) {
                System.out.println(i);
            }
        }

    }

    //带返回值的方法：计算两个整数相加的和
    public static int add(int a, int b) {
        int c = a + b;
        return c;
    }

    //获取两个数的较大值
    public static int max(int a, int b) {
        int c = 0;
        if (a > b) {
            c = a;
        } else {
            c = b;
        }
        return c;
    }

    public static void main(String[] args) {
        eat();
        study();
//        method();
        Scanner sc = new Scanner(System.in);
//        int num = sc.nextInt();
//        method1(num);

//        int num1 = sc.nextInt();
//        int num2 = sc.nextInt();
//        print(num1, num2);

//        int c = add(3, 6);
//        System.out.println(c);

        int num3 = sc.nextInt();
        int num4 = sc.nextInt();
        int max = max(num3, num4);
        System.out.println(max);

    }
}
